package com.fitness.controller;

import com.fitness.entity.NoticeEntity;
import com.fitness.res.R;
import com.fitness.service.NoticeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

@RestController
@RequestMapping(value = "notice")
public class NoticeController {
    @Resource
    private NoticeService noticeService;

    @GetMapping(value = "{id}")
    public R list(@PathVariable Long id) {

        R r = new R();
        r.setCode(200);
        Map<String, Object> m = new HashMap<>();
        m.put("list", noticeService.list(id));
        r.setData(m);
        return r;
    }
}
